<!doctype html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>医生选择</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<meta http-equiv="expires" content="0">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<link rel="stylesheet" href="../../../../css/reset.css" />
		<link href="../../../../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="../../../../css/iconfont.css" />
		<link rel="stylesheet" href="../../../../css/cmms.css" />
		<link rel="stylesheet" href="../../../../css/sale/single/selectDoctor.css" />
	</head>
	<style type="text/css">
		.check-item{
			line-height: 40px;
			
		}
		.mui-collapse-content>div{
			border-bottom: 1px solid #ccc;
		}
		.mui-collapse-content>div:last-child{
			border-bottom: none;
		}
	</style>
	<body>
		<div class="mui-content" id="selectDoctor" v-cloak>
			<!--搜索-->
			<div class="search">
				<input type="text" v-model="searchInput" class="searchInput" placeholder="请输入诊所或医生">
				<div class="btn-primary" @tap="search">搜索</div>
			</div>
			<!--列表-->
			<!-- <ul class="doctorsList" v-show="show">
				<li class="listItem" @tap="single(msg.partnerHospitalUserName,msg.partnerHospitalName,msg.partnerHospitalUserId,msg.partnerHospitalId)" v-for="msg in listMsg">
					<div class="clinic">{{msg.barcode}} {{msg.partnerHospitalName}} </div>
					<div class="doctor">
						<i class="icon iconfont icon-icon1 basic-color"></i>
						<span>{{msg.partnerHospitalUserName}}</span>
						<span class="right">(ID {{msg.partnerHospitalUserId}})</span>
					</div>
				</li>
			</ul> -->
			<li class="mui-table-view-cell mui-collapse" v-for="msg in listMsg" >
				<a class="mui-navigate-right" href="#" >
					<div class="dividingline">
						<div class="overflow">
							<i class="iconfont icon-icon1 basic-color"></i>
							<!-- <span class="doctor-name">{{msg.barcode}}</span> -->
							<span>{{msg.partnerHospitalName}}</span>
						</div>
						<p>{{msg.partnerHospitalUserName}} {{msg.partnerHospitalUserId}}</p>
					</div>
				</a>
				<div class="mui-collapse-content">
					<div class="border-1px dividingline" v-for="orders in msg.doctorVoList">
						<div class="check-item" @click="single(orders.partnerHospitalUserName,msg.partnerHospitalName,orders.partnerHospitalUserId,msg.partnerHospitalId)">{{orders.partnerHospitalUserName}}</div>
					</div>
				</div>
			</li>
			<!--未找到数据-->
			<div class="notFind" v-show="!show">
				<img src="../../../../img/notFind.png" alt="未找到对应的数据" />
				<p>暂无数据，请确认诊所或医生输入是否正确</p>
			</div>
		</div>
		<script src="../../../../js/mui.min.js"></script>
		<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
		<script src="../../../../js/vue.js"></script>
		<!-- <script type="text/javascript">document.write('<script src="js/cmms.js?timestamp='+new Date().getTime()+'" type="text/javascript" charset="utf-8"><\/script>');</script> -->
		<script src="../../../../js/cmms.js?time=444"></script>
		<script type="text/javascript">
			mui.init()
		</script>
		<script type="text/javascript">
			new Vue({
				el:"#selectDoctor",
				data:{
					token:'',
					searchInput:'',
					listMsg:'',
					show:false,
				},
				mounted(){
					this.token=localStorage.getItem('sale_token');
					this.muiInit();
				},
				methods:{
					muiInit(){
						let _this=this;
						// console.log(_this.token);
						AT.muiAjax('/partner-sale/ludan/saleByDoctor','post',{
							 partnerHospitalOrUserName:_this.searchInput
						},function(realData){
							// console.log(realData);
							// console.log(_this.searchInput);
							_this.listMsg=realData;
							if(realData.length==0){
								_this.show=false;
							}
							/*只有一个医生时直接跳转*/
//							else if(realData.length==1){
//								_this.show=true;								
//								location.href='single.html?doctor='+realData[0].partnerHospitalUserName+'&hospital='+realData[0].partnerHospitalName+'&userId='+realData[0].partnerHospitalUserId+'&partnerHospitalId='+realData[0].partnerHospitalId;
//							}
							else{
								_this.show=true;
							}
						});
					},
					/*跳转到订单页*/
					single(doctor,hospital,userId,partnerHospitalId){
						location.href = 'single.html?doctor='+doctor+'&hospital='+hospital+'&userId='+userId+'&partnerHospitalId='+partnerHospitalId;
					},
					search(){
						this.muiInit();
					}
			},
			})
		</script>
	</body>

</html>